package com.itheima.test3;

public class StringHandlerDemo {
    public static void main(String[] args) {
        useStringHandler(new StringHandler() {
            @Override
            public void printMessage(String msg) {
                System.out.println("我是匿名内部类的表达式"+msg);
            }
        });
        useStringHandler((String msg)->{
            System.out.println("我是Lamdba的表达式"+msg);
        });
    }
    public static void useStringHandler(StringHandler stringHandler){
        stringHandler.printMessage("heima程序员");
    }
}
interface StringHandler{
    void printMessage(String msg);
}


